<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

    <div>
        <p:panel header="HISTORIAL" style="border:none;">
            <!-- contenido WEB -->
            <p style="font-size: 12px; color:blue;">
                <h:panelGrid columns="4">
                    <h:outputText value="Ruc     :" />
                    <span style="font-size: 14px"><strong>"#{companyBean.company.ruc}"</strong></span>
                    <h:outputText value="Nombre  :" />
                    <span style="font-size: 14px"><strong>"#{companyBean.company.name}"</strong></span>
                    <h:outputText value="Contacto:" />
                    <span style="font-size: 14px"><strong>"#{companyBean.company.contact}"</strong></span>
                    <h:outputText value="Teléfono:" />
                    <span style="font-size: 14px"><strong>"#{companyBean.company.phone}"</strong></span>
                </h:panelGrid>
            </p>
            <h:form>  
                <p:dataTable id="carsTablex" var="carx" 
                             value="#{companyBean.listNumerSearch}">
                    <f:facet name="header">
                        Numero de busquedas realizadas
                    </f:facet>
                    <p:column style="width:2%">
                        <p:commandLink styleClass="ui-icon ui-icon-search" 
                                       action="#{companyBean.changeNumberSearch(carx)}"
                                       update=":detaildId:carsTable"/>
                    </p:column>
                    <p:column headerText="Numero de Busqueda">  
                        Ver detalles de la busqueda Número: #{carx} 
                    </p:column>
                </p:dataTable>
            </h:form>

            <p:separator />
            <h:outputText value="DETALLES DE LA BUSQUEDA SELECCIONADA"  style="font-size: 15px;color:blue;"/>
            <p:separator />
            <h:form id="detaildId">
                <p:dataTable id="carsTable" var="car" 
                             value="#{companyBean.listProfile}" 
                             sortBy="type" 
                             sortOrder="descending">  

                    <p:column id="modelHeader" headerText="Nombre" >  
                        #{car.name}  
                    </p:column>  

                    <p:column id="yearHeader" headerText="Tipo" sortBy="type">  
                        #{car.type}  
                    </p:column>  

                    <p:summaryRow>  
                        <p:column colspan="3" style="text-align:right">  
                            ------
                        </p:column>  
                    </p:summaryRow>  
                </p:dataTable>  
            </h:form>  
            <p:separator />

            <div align="center" >
                <h:form>
                    <p:commandButton value="Procesar Información" update=":panelPrincipalId"
                                     action="#{companyBean.processInformationAssociate()}">
                        <f:setPropertyActionListener
                            target="#{navigationBean.navigationContent}"
                            value="./pages/content/user/process_information.xhtml" />
                    </p:commandButton>
                </h:form>
            </div>
        </p:panel>
    </div>
</ui:composition>

